﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.ModularFixture.CCoMFConfigurationAdministratorCmd
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using System.Resources;
using System.Windows.Forms;
using Tecnomatix.Engineering;


namespace DnProcessSimulateCommands.ModularFixture;

public class CCoMFConfigurationAdministratorCmd : TxButtonCommand
{
  private CCoMFAdministratorCmdEnabler m_enabler;
  private CUiMFConfigurationAdministratorDlg m_administratorDlg;

  public CCoMFConfigurationAdministratorCmd()
  {
    this.m_enabler = new CCoMFAdministratorCmdEnabler();
  }

  public virtual void Execute(object cmdParams)
  {
    if ((TxApplication.ActiveDocument.PlatformGlobalServicesProvider as TxEmsGlobalServicesProvider).GetTypeMetaData("UnitConfigurationPrototype") == null)
    {
      int num = (int) TxMessageBox.Show(new ResourceManager("DnProcessSimulateCommands.ModularFixture.Res.StringTable", ((object) this).GetType().Assembly).GetString("CUSTOMIZATION_NOT_IMPORTED_ERROR_MESSAGE"), this.GetResourceManager().GetString("CMD_CONFIGURATION_ADMINISTRATOR_NAME"), MessageBoxButtons.OK, MessageBoxIcon.Hand);
    }
    else
    {
      if (this.m_administratorDlg != null)
      {
        ((Form) this.m_administratorDlg).Close();
        this.m_administratorDlg = (CUiMFConfigurationAdministratorDlg) null;
      }
      this.m_administratorDlg = new CUiMFConfigurationAdministratorDlg((ITxCommand) this);
      ((Control) this.m_administratorDlg).Show();
    }
  }

  public virtual string Category
  {
    get => this.GetResourceManager().GetString("CMD_CONFIGURATION_ADMINISTRATOR_CATEGORY");
  }

  public virtual string Name
  {
    get => this.GetResourceManager().GetString("CMD_CONFIGURATION_ADMINISTRATOR_NAME");
  }

  public virtual string Bitmap
  {
    get => this.GetResourceManager().GetString("CMD_CONFIGURATION_ADMINISTRATOR_BITMAP");
  }

  public virtual ITxCommandEnabler CommandEnabler => (ITxCommandEnabler) this.m_enabler;

  private ResourceManager GetResourceManager()
  {
    if (CApMFAdminUtils.m_resourceManager == null)
      CApMFAdminUtils.m_resourceManager = new ResourceManager("DnProcessSimulateCommands.ModularFixture.ConfigurationAdministrator.Res.StringTable", ((object) this).GetType().Assembly);
    return CApMFAdminUtils.m_resourceManager;
  }
}
